﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Collections;

namespace DotNETX.GIS.Web.StaticTMS.Classes
{
    [XmlRoot("Services")]
    public class Services : ICollection
    {

        private List<TileMapService> lst = new List<TileMapService>();

        public void Add(TileMapService item)
        {
            lst.Add(item);
        }

        public TileMapService this[int index]
        {
            get { return lst[index]; }
        }

        #region ICollection成员

        public void CopyTo(Array array, int index)
        {
            lst.ToArray().CopyTo(array, index);
        }

        public int Count
        {
            get { return lst.Count; }
        }

        public bool IsSynchronized
        {
            get { return false; }
        }

        public object SyncRoot
        {
            get { return null; }
        }

        public IEnumerator GetEnumerator()
        {
            return lst.GetEnumerator();
        }

        #endregion
    }
    public class TileMapService
    {
        [XmlAttribute("title")]
        public string Title { get; set; }
        [XmlAttribute("version")]
        public string Version { get; set; }
        [XmlAttribute("href")]
        public string Href { get; set; }
    }
}
